package com.yuandian.middle.platform.contoller;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.yuandian.api.middle_platform.po.OrgAbilityParam;
import com.yuandian.api.middle_platform.po.OverViewParam;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.middle.platform.service.IPlatformOverviewService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author lijunhang
 * @date 2023年05月23日 16:14
 * @description 概览及概览详情接口
 */
@Api(value = "platformOverview", tags = "概览及概览详情接口")
@RestController
@RequestMapping("/modules/platformOverview")
public class PlatformOverviewController {

	@Autowired
	private IPlatformOverviewService platformOverviewService;

	/**
	 * 全部部门类型告警数查询
	 * 部门类型，告警数
	 * 查询告警明细表，告警标识为1的数据
	 * @param param
	 * @return
	 */
	@PostMapping("/orgTypeAlarmStatistics")
	@ApiOperation(value = "单位类型告警数查询", notes = "查询告警明细表，告警标识为1的数据,接口没返回数据的时候显示暂无数据")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "orgType", value = "单位属性", paramType = "body", required = false, dataType = "String", dataTypeClass = String.class)
	})
	public R orgTypeAlarmStatistics(@ApiIgnore  @RequestBody OverViewParam param) {
		return platformOverviewService.orgTypeAlarmStatistics(param);
	}


	/**
	 * 全部单位异常能力数查询
	 * @param param
	 * @return
	 */
	@PostMapping("/orgTypeAbnormalAbility")
	@ApiOperation(value = "单位异常能力数查询", notes = "查询告警明细表，告警标识为1的数据,接口没返回数据的时候显示暂无数据")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "orgType", value = "单位属性", paramType = "body", required = false, dataType = "String", dataTypeClass = String.class)
	})
	public R orgTypeAbnormalAbility(@ApiIgnore @RequestBody OverViewParam param) {
		return platformOverviewService.orgTypeAbnormalAbility(param);
	}


	/**
	 * 概览详情列表
	 * @param param
	 * @return
	 */
	@ApiImplicitParams({
			@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "body", required = true, dataType = "String", dataTypeClass = String.class),
			@ApiImplicitParam(name = "orgTypeArr", value = "单位属性数组", paramType = "body", required = false, dataType = "array", dataTypeClass = String.class),
			@ApiImplicitParam(name = "orgName", value = "单位名称", paramType = "body", required = false, dataType = "String", dataTypeClass = String.class)
	})
	@PostMapping("/overviewDetailList")
	@ApiOperation(value = "概览详情列表", notes = "查询告警明细表，告警标识为1的数据,接口没返回数据的时候显示暂无数据")
	public R overviewDetailList(@ApiIgnore @RequestBody OverViewParam param){
		return platformOverviewService.overviewDetailList(param);
	}

}
